using System;
using System.Xml.Serialization;
using Microsoft.Office.Server.Search.Administration;

namespace Winsmarts.SSPC.CrawlProperties.BO
{
    [XmlRoot("CrawledProperty")]
    public class CrawledPropertyInfo
    {
        public CrawledPropertyInfo() { }

        private string name;
        private Guid propSet;
        private int variantType;
        private bool isNameEnum;

        [XmlAttribute]
        public int VariantType
        {
            get { return variantType; }
            set { variantType = value; }
        }

        [XmlAttribute]
        public Guid PropSet
        {
            get { return propSet; }
            set { propSet = value; }
        }

        [XmlAttribute]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        [XmlAttribute]
        public bool IsNameEnum
        {
            get { return isNameEnum; }
            set { isNameEnum = value; }
        }

        public CrawledPropertyInfo(CrawledProperty crawledProperty)
        {
            name = crawledProperty.Name;
            propSet = crawledProperty.Propset;
            variantType = crawledProperty.VariantType;
            isNameEnum = crawledProperty.IsNameEnum;

        }

        public CrawledPropertyInfo(string name, int variantType, Guid propSet)
        {
            //Underspecified instantiation

            this.name = name;
            this.variantType = variantType;
            this.propSet = propSet;
        }
    }
}
